package org.aepscolombia.platform.models.entity;
// Generated Jan 13, 2014 2:36:33 PM by Hibernate Tools 3.2.1.GA


import java.util.Date;
import java.util.HashSet;
import java.util.Set;
import javax.persistence.CascadeType;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import static javax.persistence.GenerationType.IDENTITY;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToMany;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;

/**
 * Fertilizations generated by hbm2java
 */
@Entity
@Table(name="fertilizations"
    ,catalog="madr_bd10"
)
public class Fertilizations  implements java.io.Serializable {


     private Integer idFer;
     private ProductionEvents productionEvents;
     private CropsTypes cropsTypes;
     private FertilizationsTypes fertilizationsTypes;
     private Date dateFer;
     private double amountProductUsedFer;
     private String whereBoughtFer;
     private String applicationTechniqueFer;
     private String otherWhereBoughtFer;
     private Set chemicalFertilizationses = new HashSet(0);
     private Set organicFertilizationses = new HashSet(0);
     private Set amendmentsFertilizationses = new HashSet(0);

    public Fertilizations() {
    }

	
    public Fertilizations(ProductionEvents productionEvents, FertilizationsTypes fertilizationsTypes, Date dateFer, double amountProductUsedFer) {
        this.productionEvents = productionEvents;
        this.fertilizationsTypes = fertilizationsTypes;
        this.dateFer = dateFer;
        this.amountProductUsedFer = amountProductUsedFer;
    }
    public Fertilizations(ProductionEvents productionEvents, CropsTypes cropsTypes, FertilizationsTypes fertilizationsTypes, Date dateFer, double amountProductUsedFer, String whereBoughtFer, String applicationTechniqueFer, String otherWhereBoughtFer, Set chemicalFertilizationses, Set organicFertilizationses, Set amendmentsFertilizationses) {
       this.productionEvents = productionEvents;
       this.cropsTypes = cropsTypes;
       this.fertilizationsTypes = fertilizationsTypes;
       this.dateFer = dateFer;
       this.amountProductUsedFer = amountProductUsedFer;
       this.whereBoughtFer = whereBoughtFer;
       this.applicationTechniqueFer = applicationTechniqueFer;
       this.otherWhereBoughtFer = otherWhereBoughtFer;
       this.chemicalFertilizationses = chemicalFertilizationses;
       this.organicFertilizationses = organicFertilizationses;
       this.amendmentsFertilizationses = amendmentsFertilizationses;
    }
   
     @Id @GeneratedValue(strategy=IDENTITY)
    
    @Column(name="id_fer", unique=true, nullable=false)
    public Integer getIdFer() {
        return this.idFer;
    }
    
    public void setIdFer(Integer idFer) {
        this.idFer = idFer;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="id_production_event_fer", nullable=false)
    public ProductionEvents getProductionEvents() {
        return this.productionEvents;
    }
    
    public void setProductionEvents(ProductionEvents productionEvents) {
        this.productionEvents = productionEvents;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="fertilized_crop_fer")
    public CropsTypes getCropsTypes() {
        return this.cropsTypes;
    }
    
    public void setCropsTypes(CropsTypes cropsTypes) {
        this.cropsTypes = cropsTypes;
    }
@ManyToOne(fetch=FetchType.LAZY)
    @JoinColumn(name="fertilization_type_fer", nullable=false)
    public FertilizationsTypes getFertilizationsTypes() {
        return this.fertilizationsTypes;
    }
    
    public void setFertilizationsTypes(FertilizationsTypes fertilizationsTypes) {
        this.fertilizationsTypes = fertilizationsTypes;
    }
    @Temporal(TemporalType.TIMESTAMP)
    @Column(name="date_fer", nullable=false, length=19)
    public Date getDateFer() {
        return this.dateFer;
    }
    
    public void setDateFer(Date dateFer) {
        this.dateFer = dateFer;
    }
    
    @Column(name="amount_product_used_fer", nullable=false, precision=22, scale=0)
    public double getAmountProductUsedFer() {
        return this.amountProductUsedFer;
    }
    
    public void setAmountProductUsedFer(double amountProductUsedFer) {
        this.amountProductUsedFer = amountProductUsedFer;
    }
    
    @Column(name="where_bought_fer", length=17)
    public String getWhereBoughtFer() {
        return this.whereBoughtFer;
    }
    
    public void setWhereBoughtFer(String whereBoughtFer) {
        this.whereBoughtFer = whereBoughtFer;
    }
    
    @Column(name="application_technique_fer", length=20)
    public String getApplicationTechniqueFer() {
        return this.applicationTechniqueFer;
    }
    
    public void setApplicationTechniqueFer(String applicationTechniqueFer) {
        this.applicationTechniqueFer = applicationTechniqueFer;
    }
    
    @Column(name="other_where_bought_fer", length=65535)
    public String getOtherWhereBoughtFer() {
        return this.otherWhereBoughtFer;
    }
    
    public void setOtherWhereBoughtFer(String otherWhereBoughtFer) {
        this.otherWhereBoughtFer = otherWhereBoughtFer;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="fertilizations")
    public Set getChemicalFertilizationses() {
        return this.chemicalFertilizationses;
    }
    
    public void setChemicalFertilizationses(Set chemicalFertilizationses) {
        this.chemicalFertilizationses = chemicalFertilizationses;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="fertilizations")
    public Set getOrganicFertilizationses() {
        return this.organicFertilizationses;
    }
    
    public void setOrganicFertilizationses(Set organicFertilizationses) {
        this.organicFertilizationses = organicFertilizationses;
    }
@OneToMany(cascade=CascadeType.ALL, fetch=FetchType.LAZY, mappedBy="fertilizations")
    public Set getAmendmentsFertilizationses() {
        return this.amendmentsFertilizationses;
    }
    
    public void setAmendmentsFertilizationses(Set amendmentsFertilizationses) {
        this.amendmentsFertilizationses = amendmentsFertilizationses;
    }




}


